package com.lock8;

import java.util.concurrent.TimeUnit;


/**
 * synchronize对不同的对象没有影响
 */
public class Test2 {

    public static void main(String[] args) throws Exception {
        Phone phone1 = new Phone();
        Phone phone2 = new Phone();

        new Thread(() -> {
            try {
                phone1.sendMsg();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "A").start();

        new Thread(() -> {
            phone2.call();
        }, "B").start();


    }
}
